package com.cmii.sjw.department.control.jsc.config;

import com.alibaba.xxpt.gateway.shared.client.http.ExecutableClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ClientConfig {

    @Autowired
    private YkzConfig ykzConfig;

    @Bean
    public ExecutableClient executableClient() {
        ExecutableClient executableClient = ExecutableClient.getInstance();
        // DomainName不同环境对应不同域名，示例为sass域名
        executableClient.setDomainName(ykzConfig.getDomain());
        executableClient.setProtocal(ykzConfig.getProtocal());
        // 应用App Key
        executableClient.setAccessKey(ykzConfig.getAppkey());
        // 应用App Secret
        executableClient.setSecretKey(ykzConfig.getAppsecret());
        executableClient.init();
        return executableClient;
    }
}
